package com.jumi.microservice.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jumi.microservice.domain.Department;
import com.jumi.microservice.domain.dto.DepartmentDTO;
import com.jumi.microservice.domain.vo.DepartmentQuery;
import com.jumi.microservice.domain.vo.DepartmentRequest;
import com.jumi.microservice.domain.vo.DepartmentVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 部门表 服务类
 * </p>
 *
 * @author liuz
 * @since 2020-07-18
 */
public interface DepartmentService extends IService<Department> {
    /**
     * 新增一条部门表数据
     *
     * @param dto
     */
    void insert(DepartmentDTO dto, HttpServletRequest request);

    /**
     * 删除部门信息
     *
     * @param id
     */
    void delete(Long id, HttpServletRequest request);

    /**
     * 更新部门表数据
     *
     * @param vo
     */
    void update(DepartmentDTO vo, HttpServletRequest request);

    /**
     * 查询一条数据
     *
     * @param id
     * @return
     */
    DepartmentDTO selectById(Long id);

    /**
     * 部门状态启用/停用
     *
     * @param id
     * @param status
     */
    void enableStatus(Long id, Integer status, HttpServletRequest request);

    /**
     * 查询部门下所有子部门信息（向下查询）
     * @return
     */
    List<DepartmentQuery> selectSonDepartmentId();


    List<DepartmentVO> selectList(DepartmentRequest request);

    /**
     * 查询部门下所有子部门信息（向上查询）
     * @param vo
     * @return
     */
    List<Department> selectDepartmentList(DepartmentVO vo);


    /**
     * 获取所以父级菜单
     */
    String selectParentList(Long id);

}
